package com.yuefresh.dish;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


/**
 * 
 * @Description: 问题控制类
 * @author junhao
 * @since 2013-3-17 下午15:29:25 
 */
@Controller
@RequestMapping("/dish")
public class DishController {
	private final static Logger logger = LoggerFactory.getLogger(DishController.class);
	
	@Autowired private DishManager dishManager;
	
	@RequestMapping//main page
	public ModelAndView execute(HttpServletRequest request) {
		logger.info("dish execute!");
		//Forward===================================================
		ModelAndView mv = new ModelAndView("issue/issue_main");
		
		return mv;
	}
	
	@RequestMapping(params="m=show")
	public ModelAndView show(HttpServletRequest request, Long id) {
		Dish dish = dishManager.get(id);
		
		//Forward===================================================
		ModelAndView mv = new ModelAndView("dish/dish_show");
		mv.addObject("entity", dish);
		
		return mv;
	}

}
